package com.zcf.controller;


import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.zcf.common.json.Body;
import com.zcf.pojo.Service;
import com.zcf.service.ServiceServiceImpl;
import com.zcf.vo.out.LayuiJson;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ZhaoQi
 * @since 2019-03-18
 */
@CrossOrigin
@Controller
@RequestMapping("/service")
public class ServiceController {
	@Autowired
	ServiceServiceImpl ss;
	
/**
 * 后端获取 客服信息
 * @return
 */
    @PostMapping("getService")
    @ResponseBody
    public LayuiJson getService(){
        return ss.getService();
    }
	
   /**
    * 前端获取客服信息
    * @return
    */
    @PostMapping("getServices")
    @ResponseBody
    public Body getServices(){
        return ss.getServices();
    }
	/**
	 * 客服信息修改
	 * @param service
	 * @return
	 */
    @PostMapping("update")
    @ResponseBody
    public Body update(Service service){
        return ss.update(service);
    }
}

